<?php if (!defined('THINK_PATH')) exit();?>	<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>广东国防教育学会</title>
		<meta name="viewport" content="initial-scale=1, maximum-scale=1">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.min.css" />
		<link rel="stylesheet" href="http://idangero.us/swiper/dist/css/swiper.min.css" />
		<link rel="stylesheet" href="/Public/Home/activity/css/style.css" />
	</head>
	<body>

		<div class="bar bar-nav">
			<h1 class="title">专家申请</h1>
			<i class="icon icon-left" onclick="window.history.go(-1);"></i>
		</div>
		<div class="content">
                    <form enctype="multipart/form-data" id="defaultForm" class="form-horizontal" action="<?php echo U('Apply/expert_join');?>" method="post">
			<div class="list-block join">
		    <ul>
		      <!-- Text inputs -->
                       <li>
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-name"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">姓名：</div>
		            <div class="item-input">
		              <input type="text" placeholder="请输入姓名" name="user_name" value="<?php echo ($apply["user_name"]); ?>" class='form-control'>
		            </div>
		          </div>
		        </div>
		      </li>
		      <li>
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-name"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">单位名称：</div>
		            <div class="item-input">
		              <input type="text" placeholder="请输入单位名称" name="job_name" value="<?php echo ($apply["job_name"]); ?>"  class='form-control'>
		            </div>
		          </div>
		        </div>
		      </li>
		      <li>
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-email"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">申请类型：</div>
		            <div class="item-input">
                                <select name="type">
		              	<option value="1" <?php if($apply["type"] == 1): ?>selected<?php endif; ?>>军事专家</option>
		              	<option value="2" <?php if($apply["type"] == 2): ?>selected<?php endif; ?>>国防专家</option>
		              	<option value="3" <?php if($apply["type"] == 3): ?>selected<?php endif; ?>>医学专家</option>
		              </select>
		            </div>
		          </div>
		        </div>
		      </li>
		      <li style='margin-bottom: 0px;'>
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-password"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">联系电话：</div>
		            <div class="item-input">
		              <input type="tel" placeholder="请输入联系方式" name="phone"  value="<?php echo ($apply["phone"]); ?>"  class='form-control'>
		            </div>
		          </div>
		        </div>
		      </li>
                      <li style='border-top:0;'>
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-name"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">E_mail：</div>
		            <div class="item-input">
		              <input type="text" placeholder="你的邮箱地址" name="email" value="<?php echo ($apply["email"]); ?>"  class='form-control'>
		            </div>
		          </div>
		        </div>
		      </li>
                      <li style='margin-top: 0px;border-top:0;'>
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-name"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">视频连接：</div>
		            <div class="item-input">
		              <input type="text" placeholder="视频连接地址" name="video_url" value="<?php echo ($apply["video_url"]); ?>"  class='form-control'>
		            </div>
		          </div>
		        </div>
                          <span style="font-size: 12px;margin-left: 20px;color: green;">视频链接遵循http协议，如：http://www.baidu.com</span>
		      </li>
		      <!-- Date -->
                      <li>
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-calendar"></i></div>
		          <div class="item-inner">
		            <div class="item-title label" style='width: 35%;'>一寸证件照：</div>
		            <div class="item-input" id="file-pretty">
                                <input type="file" name="headimgurl" class="form-control">
                              
		            </div>
                            
		          </div>
                          <input type="hidden" name="old_headimgurl" value="<?php echo ($apply["headimgurl"]); ?>" />
                          <?php if($apply['img'] != ''): ?><a target="_blank" href="<?php echo ($apply["headimgurl"]); ?>"><img src="<?php echo ($apply["headimgurl"]); ?>" style="width: 50px;height: 50px;margin-right: 10px;margin-top: 6px;"></a><?php endif; ?>
		        </div>
                          <span style="font-size: 12px;margin-left: 20px;color: green;">温馨提示：图片尺寸建议为：413 X 295，图片小于1M</span>
		      </li>
		      <li>
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-calendar"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">证明材料：</div>
		            <div class="item-input" id="file-pretty">
                                <input type="file" name="img" class="form-control">
                              
		            </div>
                            
		          </div>
                          <input type="hidden" name="old_img" value="<?php echo ($apply["img"]); ?>" />
                          <?php if($apply['img'] != ''): ?><a target="_blank" href="<?php echo ($apply["img"]); ?>"><img src="<?php echo ($apply["img"]); ?>" style="width: 50px;height: 50px;margin-right: 10px;margin-top: 6px;"></a><?php endif; ?>
		        </div>
                          <span style="font-size: 12px;margin-left: 20px;color: green;">温馨提示：图片尺寸建议为：600*600，图片小于4M</span>
		      </li>
                       <li>
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-calendar"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">上传照片墙：</div>
                            <div class="item-input" id="file_input" style='width: 60%;float: left'>
                                <input type="file" name="more_img[]" multiple class="form-control">
		            </div>
                            <a id="more_file_input" style='width: 30px;border-radius: 4px; color: #fff; font-weight: bold; font-size: 16px; text-align: center;display: block;background: #0894ec;'>  +  </a>
		        </div>
                          <input type="hidden" name="old_more_img" value="<?php echo ($apply["more_img"]); ?>" />
		        </div>
                          <span style="font-size: 12px;margin-left: 20px;color: green;">温馨提示：图片尺寸建议为：600*600，图片小于4M</span>
                          <div style='padding: 0 10px;'>
                           <?php if($apply['more_img']): if(is_array($apply['more_img_list'])): $i = 0; $__LIST__ = $apply['more_img_list'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vv): $mod = ($i % 2 );++$i;?><!--<a target="_blank" href="<?php echo ($vv); ?>">-->
                              <img src="<?php echo ($vv); ?>" style="width: 50px;height: 50px;margin-right: 6px;margin-top: 6px;">
                          <!--</a>--><?php endforeach; endif; else: echo "" ;endif; endif; ?>
                          </div>
                          
		      </li>
                      <li class="align-top">
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-comment"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">个人简介：</div>
		            <div class="item-input">
                                <textarea placeholder="个人简介" name="introduce"><?php echo ($apply["introduce"]); ?></textarea>
		            </div>
		          </div>
		        </div>
                          <!--<span style="font-size: 12px;margin-left: 20px;color: green;">温馨提示：250字以内</span>-->
		      </li>
		      <li class="align-top">
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-comment"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">个性签名：</div>
		            <div class="item-input">
                                <textarea placeholder="签名" name="signature"><?php echo ($apply["signature"]); ?></textarea>
		            </div>
		          </div>
		        </div>
                          <!--<span style="font-size: 12px;margin-left: 20px;color: green;">温馨提示：250字以内</span>-->
		      </li>
		      <li class="align-top">
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-comment"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">补充说明：</div>
		            <div class="item-input">
                                <textarea placeholder="备注" name="explain"><?php echo ($apply["explain"]); ?></textarea>
		            </div>
		          </div>
		        </div>
                          <!--<span style="font-size: 12px;margin-left: 20px;color: green;">温馨提示：内容不宜过长</span>-->
		      </li>
                      
                      <li style='border-top:0;'>
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-name"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">审核结果：</div>
		            <div class="item-input">
		              <?php switch($apply['status']): case "2": ?><font color="#de9c00">待审核</font><?php break;?>
                                <?php case "1": ?><font color="#0894ec">审核通过</font><?php break;?>
                                <?php case "3": ?><font color="#f00">不通过</font><?php break; endswitch;?>
		            </div>
		          </div>
		        </div>
		      </li>
                      <?php if($apply['status'] == 3): ?><li style='border-top:0;'>
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-name"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">原因：</div>
		            <div class="item-input">
                                <?php echo ($apply["reason"]); ?>
		            </div>
		          </div>
		        </div>
		      </li><?php endif; ?>
		    </ul>
		  </div>
		  <div class="content-block">
		    <div class="row">
		      <div class="col-100 text-center">
                          <!--<input type="submit" class="button button-big button-fill button-danger" value="提交">-->
                          <button class="button button-big button-fill button-danger" id='submitForm' style='width: 100%;'>提交</button>
                      </div>
		    </div>
		  </div>
                </form>
		</div>

	
		<script type="text/javascript" src="http://g.alicdn.com/sj/lib/jquery/dist/jquery.min.js"></script>
		<script type='text/javascript' src='http://g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
		<script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
		<script src="http://idangero.us/swiper/dist/js/swiper.min.js"></script>
		<script type="text/javascript" src="/Public/Home/activity/js/huodon.js" ></script>
		<script>
			
			var swiper = new Swiper('.swiper-container', {
				pagination: '.swiper-pagination',
				paginationClickable: true,
				loop:true,    
				grabCursor: true,
				autoplay: 3000
			});
			
			 /* $(document).on('click','.open-preloader', function () {
				 Zepto.showPreloader('加载中...')
				    setTimeout(function () {
				    	 Zepto.hidePreloader();
				    }, 2000); 
			 }); */
			 $(document).on('click','.open-indicator', function () {
				 Zepto.showIndicator();
			     setTimeout(function () {
			    	Zepto.hideIndicator();
			     }, 2000);
			  });
		</script>
		

	</body>

</html>
        
        
<script>
    $('#more_file_input').click(function(){
         var number = $('#file_input input').length;
        if(number<10){
            $("#file_input").append('<div style="margin-top:5px"><input type="file" name="more_img[]" /></div>');
        }else{
            Zepto.toast('最多只能上传十张！', 2000, 'success top');
             return false;   
         }
    });
    
	var myreg = /(1[3-9]\d{9})$/;
	var true_or_false = true;
	$("#defaultForm").submit(function(){
		 var user_name = $("input[name='user_name']").val();
		 var job_name = $("input[name='job_name']").val();
		 var phone = $("input[name='phone']").val();
                 var email = $("input[name='email']").val();
                 var introduce = $("input[name='introduce']").val();
                 var headimgurl = $("input[name='headimgurl']").val();
		 var old_headimgurl = $("input[name='old_headimgurl']").val();
		 var email_regular = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;	//邮箱
		 var img = $("input[name='img']").val();
                 var old_img = $("input[name='old_img']").val();
		 if(user_name == ''){
			 Zepto.toast('请填写姓名！', 2000, 'success top');
			 return false;
		 }
		 if(job_name == ''){
			 Zepto.toast('请填写单位名称！', 2000, 'success top');
			 return false;
		 }
		 if(phone == ''){
			 Zepto.toast('请填写手机号码！', 2000, 'success top');
			 return false;
		 }
		 if(!myreg.test(phone)){
			 Zepto.toast('手机格式不正确！', 2000, 'success top');
			 return false;
		 }
		 if(email == ''){
			 Zepto.toast('请填写邮箱！', 2000, 'success top');
			 return false;
		 }
		 if(!email_regular.test(email)){ 
			 Zepto.toast('邮箱格式不正确！', 2000, 'success top');
			 return false;
	 	 }
                 if(introduce == ''){
			 Zepto.toast('请填写个人简介！', 2000, 'success top');
			 return false;
		 }
                 if((headimgurl == '') && (old_headimgurl == '')){
			 Zepto.toast('请上传一寸证件照！', 2000, 'success top');
			 return false;
		 }
		 if((img == '') && (old_img == '')){
			 Zepto.toast('请上传证明材料！', 2000, 'success top');
			 return false;
		 }

	});
	
	
</script>
</html>